import Vue from 'vue'
import App from './App'
import router from './router'
// elmentUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import CollapseTransition from 'element-ui/lib/transitions/collapse-transition';
// mui
import './assets/mui/dist/css/mui.min.css'
// mint-ui
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import {
    Tabbar,
    TabItem,
    Header,
    Search,
    IndexList,
    IndexSection,
    Popup,
    InfiniteScroll,
    TabContainer,
    TabContainerItem
} from 'mint-ui';
import Vuex from 'vuex'

// elementui
Vue.use(ElementUI);
Vue.component(CollapseTransition.name, CollapseTransition)
    // mint-ui
Vue.use(MintUI)
Vue.component(Tabbar.name, Tabbar);
Vue.component(TabItem.name, TabItem);
Vue.component(Header.name, Header);
Vue.component(Search.name, Search);
Vue.component(IndexList.name, IndexList);
Vue.component(IndexSection.name, IndexSection);
Vue.component(Popup.name, Popup);
Vue.component(TabContainer.name, TabContainer);
Vue.component(TabContainerItem.name, TabContainerItem);
Vue.use(InfiniteScroll);
Vue.use(Vuex)
Vue.config.productionTip = false
    // 解决页面不是从顶部开始刷新
router.afterEach((to, from, next) => {
    window.scrollTo(0, 0)
});

const store = new Vuex.Store({
    state: {
        status: 0, //登录状态
        address: '未能获取地址', //当前地址
        shopId: 1, //商品页ID
        // 购物车相关               
        merCount: 0, //商品总数
        priceCount: 0, //价钱总数
        pay: 0, //最终要付,
        product: [], // 点的东西
        user: {
            name: '登录/注册',
            phone: '登录后享受更多特权',
        }, //登录信息
        orderInfo: false //订单信息
    },
    mutations: {

    },
    // 过滤器
    getters: {

    }
})

new Vue({
    el: '#app',
    router,
    render: c => c(App),
    store
})